# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=pinentry
pkgver=0.9.1
pkgrel=1
pkgdesc='A collection of simple PIN or passphrase entry dialogs which utilize the Assuan protocol'
url='http://gnupg.org/related_software/pinentry/'
license=('GPL')
arch=('i686' 'x86_64')
makedepends=('ncurses-devel')
depends=('ncurses')
source=(ftp://ftp.gnupg.org/gcrypt/${pkgname}/${pkgname}-${pkgver}.tar.bz2{,.sig}
        pinentry-0.9.1-msysize.patch)
install=pinentry.install
md5sums=('d224d031130aedb44b05164cb04ed88b'
         'SKIP'
         'b1130c8c4027c2700b60b1d67199da4d')
validpgpkeys=('D8692123C4065DEA5E0F3AB5249B39D24F25E3B6') # Werner Koch

install=${pkgname}.install

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  patch -p1 -i ${srcdir}/pinentry-0.9.1-msysize.patch
  
  ./autogen.sh
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  ./configure \
    --build=${CHOST} \
    --prefix=/usr \
    --enable-pinentry-curses \
    --disable-pinentry-gtk2 \
    --disable-pinentry-qt4 \
    --enable-fallback-curses

  make
}

check() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make check
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
}
